<form style="padding:30px;" class="layui-form layui-form-pane goodsCatForm">
    <input type="hidden" id="id" name="id" value="{$data.id}">

    <div class="layui-form-item">
        <label class="layui-form-label">分类名称：</label>
        <div class="layui-input-block">
            <input type="text" name="name" id="name" required lay-verify="required" placeholder="请输入分类名称" class="layui-input" value="{$data.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序：</label>
        <div class="layui-input-block">
            {php}
                if($data){
                    $sort = $data['indexid'];
                }else{
                    $sort = 100;
                }
            {/php}
            <input type="number" name="indexid" id="sort" style="width:60px;" required lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input" value="{$sort}">
        </div>
    </div>
    {:zbToken()}
</form>

<script>
    //渲染表单
    layui.use('form', function(){
        var form = layui.form;
        form.render();
    });
</script>